package com.example.testvolication.pojo.dto;

import com.example.testvolication.pojo.valid.group.NameAndTypeGroup;
import com.example.testvolication.pojo.valid.group.NameGroup;
import com.example.testvolication.pojo.valid.group.TypeGroup;
import lombok.Builder;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * @author zhangs
 * @date 2022/5/18 13:40
 */
@Data
@Builder
public class GroupingDemo {

    @NotNull(message = "名称不能为空" , groups = {NameAndTypeGroup.class , NameGroup.class})
    private String name;

    @NotNull(message = "类型不能为空" , groups = {TypeGroup.class , NameAndTypeGroup.class})
    private Integer type;
    /**
     * 特殊(用来测试多group生效)
     */
    private Integer isCase;
}
